﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Design
{
    public partial class Site : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if ((Convert.ToString(Session["accessLvl"]) == "Reception") || (Convert.ToString(Session["accessLvl"]) == "Management") || (Convert.ToString(Session["accessLvl"]) == "Admin"))
                {
                    btnHome.Enabled = true;
                    btnHome.Visible = true;
                    btnBooking.Enabled = true;
                    btnBooking.Visible = true;
                    btnReporting.Enabled = true;
                    btnReporting.Visible = true;
                    btnAccount.Enabled = true;
                    btnAccount.Visible = true;
                    btnLogout.Enabled = true;
                    btnLogout.Visible = true;
                }

                if ((Convert.ToString(Session["accessLvl"]) == "Management") || (Convert.ToString(Session["accessLvl"]) == "Admin"))
                {
           
                    btnHousekeeping.Enabled = true;
                    btnHousekeeping.Visible = true;
                }
            }
        }

        protected void btnBooking_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/BookingModule/BookingMainPage.aspx");
        }

        protected void btnHousekeeping_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/StaffHousekeepingModule/StaffHousekeepingMainPage.aspx");
        }

        protected void btnReporting_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/ReportingModule/ReportingViewReport.aspx");
        }

        protected void btnAccount_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/UserModule/AccountManagement.aspx");
        }

        protected void btnLogout_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Redirect("~/UserModule/Login.aspx");
        }

        protected void btnHome_Click(object sender, EventArgs e)
        {
            
            Response.Redirect("~/BookingModule/RoomAvailability.aspx");
        }
    }
}